import java.util.*;
class Solution {
    public static void main(String[] args) {
        Scanner s = new Scanner(System.in);
        int K;//目标金额
        int res = 999999999; //答案
        System.out.print("请输入金额:");
        K = s.nextInt();
        int coins[] = new int[]{1,2,5,10,20,50,100}; //钞票面额
        int dp[][] = new int[coins.length][K + 1]; //动态规划
        for(int i = 0; i <= K; i++) dp[0][i] = i; //初始化
        for(int i = 1; i < coins.length; i++) //循环
        {
            for(int j = 0; j <= K; j++) {
                if(j - coins[i] >= 0) {
                    dp[i][j] = Math.min(dp[i][j - coins[i]] + 1, dp[i - 1][j]); //递推关系
                }
                else dp[i][j] = dp[i - 1][j];
            }
            res = Math.min(res, dp[i][K]); //记录
        }
        if(res == 999999999) {
            System.out.print("找不开");
        }
        else {
            System.out.print("最少需要" + res + "张纸币");
        }
    }
}